import { DiyComponent } from '../types'

export interface FormConfigDiyTextarea {
  __config__: {
    label: string
    model: string
    modelDesc: string
    span: number
    labelWidth: number
    width: string
  }
  __attr__: {
    defaultValue: string
    type: string
    placeholder: string
    maxLength: number
    clearable: boolean
    disabled: boolean
  }
  __slot__: {
    prepend: string
    append: string
  }
  on: {
    change: string
    blur: string
  }
}

// 定义页面组件及属性默认值
export const component = {
  id: 'DiyTextarea',
  name: '文本域输入',
  icon: '',
  property: {
    __config__: {
      label: '文本域输入',
      model: '',
      span: 24,
      labelWidth: 0,
      width: '100%',
    },
    __attr__: {
      defaultValue: '',
      type: 'textarea',
      placeholder: '请输入',
      maxLength: 100,
      clearable: false,
      disabled: false,
    },
    __slot__: {
      prepend: '',
      append: '',
    },
    on: {
      change: '({ data, formData, setFormData }) => {}',
      blur: '({ data, formData, setFormData }) => {}',
    },
  },
} as DiyComponent<FormConfigDiyTextarea>
